package jalus.model;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Link;
import com.google.appengine.api.datastore.Text;
import com.google.appengine.api.users.User;


/**
 * 评论数据表
 * @author dongliu
 *
 */
@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true")
public class Comment {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Long id;
    @Persistent
    private Long postId;
    @Persistent
    private Date date;
	private Date last_modify_date;
    private User last_modify_by;
    @Persistent
    private User author;
    @Persistent
    private Text content;
    @Persistent
    private String username;
    @Persistent
    private Link homepage;
    @Persistent
    private String email;
    @Persistent
    private String ip;
    
    public Comment(){}
	public Comment(Long postId, Date date, User author, Text content){
    	this.postId = postId;
    	this.date = date;
    	this.author = author;
    	this.content = content;
    }
    public Comment(Long postId, Date date, String username, Text content, String ip){
    	this.postId = postId;
    	this.date = date;
    	this.username = username;
    	this.content = content;
    	this.ip = ip;
    }
    public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public Long getPostId() {
		return postId;
	}
	public void setPost(Long postId) {
		this.postId = postId;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public User getAuthor() {
		return author;
	}
	public void setAuthor(User author) {
		this.author = author;
	}
	public Text getContent() {
		return content;
	}
	public void setContent(Text content) {
		this.content = content;
	}
	public Date getLast_modify_date() {
		return last_modify_date;
	}
	public void setLast_modify_date(Date last_modify_date) {
		this.last_modify_date = last_modify_date;
	}
	public User getLast_modify_by() {
		return last_modify_by;
	}
	public void setLast_modify_by(User last_modify_by) {
		this.last_modify_by = last_modify_by;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getUsername() {
		return username;
	}
	public void setIp(String ip) {
		this.ip = ip;
	}
	public String getIp() {
		return ip;
	}
    public Link getHomepage() {
		return homepage;
	}
	public void setHomepage(Link homepage) {
		this.homepage = homepage;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}

}
